package com.example.javabasic.shejimoshi.guanchazhe.demo1;
//观察者模式
public class Test {
    public static void main(String[] args) {
        //创建事件
        ConcreteSubject subject = new ConcreteSubject();
        //添加观察者A
        subject.add(new ConcreteObserverA());
        //添加观察者B
        subject.add(new ConcreteObserverB());
        //通知所有观察者
        subject.notifyObserver();
    }
}
